package models

import (
	"github.com/astaxie/beego/orm"
	_"github.com/go-sql-driver/mysql"
)

type User struct {
	Id   int
	Name string
	Pwd  string
}

func init(){
	// set default database
	orm.RegisterDataBase("default", "mysql", "root:123456@tcp(127.0.0.1:3306)/test02?charset=utf8", 30)

	// register model  tableName = User
	orm.RegisterModel(new(User))

	// create table
	orm.RunSyncdb("default", false, true)
}
